from django.shortcuts import render
from rest_framework.generics import ListAPIView
from . import models, serializers
from luffy.settings import contants


class BannerAPIView(ListAPIView):
    queryset = models.Banner.objects.filter(is_deleted=False, is_show=True)[:contants.BANNER_LENGTH]

    serializer_class = serializers.BannerModelSerializer


class NavAPIView(ListAPIView):
    queryset = models.Nav.objects.filter(is_deleted=False, is_show=True, position=1)[:contants.HEADER_NAV_LENGTH]

    serializer_class = serializers.NavModelSerializer
